<style type="text/css">
<!--
@import url("style.css");
-->
</style>
<div class="includedFileFont">
<?php

// Register User
 	$username = $_POST['username'];
		//Check Username
		$ChkPt1 = ChkUserName($username);
		
		
	if($ChkPt1 == 1)
	{	
		$email = $_POST['email'];
		// Check Email
		$ChkPt2 = ChkEmail($email);
		
		if($ChkPt2 == 1)
		{	
			// If Username & Email are Unique, then Check if the passwords match.
    		$passworda = $_POST['passworda'];
			$passwordb = $_POST['passwordb'];
				// Check Password
				$ChkPt3 = ChkPassword($passworda,$passwordb);
				
				if($ChkPt3 == 1)
				{	
    				// MD5 Password	

    				$MD5Password = md5($passworda);
					
					if($ChkPt1 == 1 && $ChkPt2 == 1 && $ChkPt3 == 1)
					{
						// When all three chekpoints are clear then we add the user to the database
							
						// Enter user into the user_table	
						$InsertNewUser = "INSERT INTO `user_table` (`username`, `password`, `email`, `GID`) VALUES ('$username', '$MD5Password', '$email', '2')";
						mysql_query($InsertNewUser) or die("could not register users or send email out");
						
						print "Registration successful.  You may now login.<br>";
					}
					else
					{
						print "FAILED";
						print "<META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php?'>"; // by default the index.php page (set 1.31.2010 - 08:30pm)
					}
				}
				else
				{
					print "FAILED";
					print "<META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php?'>"; // by default the index.php page (set 1.31.2010 - 08:30pm)
				}
			}
			else
			{
				print "FAILED";
				print "<META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php?'>"; // by default the index.php page (set 1.31.2010 - 08:30pm)
			}
		}
		else
		{
			print "FAILED";
			print "<META HTTP-EQUIV = 'Refresh' Content = '2; URL =index.php?'>"; // by default the index.php page (set 1.31.2010 - 08:30pm)
		}

?>
</div>